#include "PixelNode.h"

PixelNode::PixelNode() {

}

PixelNode::PixelNode(const PixelNode& node) {//copy constructor
	//for (int k = 0; k < 8; ++k)
	//	linkCost[k] = node.linkCost[k];
	state		= node.state;
	totalCost	= node.totalCost;
	prevNode	= node.prevNode;
	column		= node.column;
	row			= node.row;
	counter		= node.counter;
}

PixelNode::~PixelNode() {

}

void PixelNode::operator =(FibHeapNode& RHS){
	//printf("calling PixelNode =");
	FHN_Assign(RHS);
	totalCost = ((PixelNode&)RHS).totalCost;
}

int PixelNode::operator <(FibHeapNode& RHS){
	//printf("calling Pixel Node\n");
	int x = FHN_Cmp(RHS);
	if (x)
		return x < 0 ? 1 : 0;
	else {
		return (totalCost < ((PixelNode&)RHS).totalCost) ? 1: 0;
	}
}

int PixelNode::operator ==(FibHeapNode& RHS) {
	//printf("calling pixel node ==\n");
	int x = FHN_Cmp(RHS);
	if (x)
		return 0;
	else return (totalCost == ((PixelNode&)RHS).totalCost) ? 1: 0;
}




